namespace Expect.Documentation.Base_concepts
{
    using System;
    using Expect.Core;
    using Expect.Core.Fixtures;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    
    
    // This file is generated, if you modify content you will lose your modifications when the generator will regenerate the file
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Expect.Core", "0.5.2.0")]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [TestClass()]
    [SpecificationContainerAttribute(Name="Fixture methods", Path="\\Base concepts\\Fixture methods.expect")]
    public partial class FixtureMethodsContainer : Expect.Core.AbstractSpecificationContainer
    {
        
        partial void PrepareContextExtension();
        
        partial void BeforeInitExtension();
        
        partial void AfterInitExtension();
        
        partial void BeforeTeardownExtension();
        
        partial void AfterTeardownExtension();
        
#line 1 "Fixture methods.expect"
#line hidden
        
        public override void InitializeContext()
        {
            base.InitializeContext();
            PrepareContextExtension();
        }
        
        [TestInitialize()]
        public virtual void FixtureMethodsClass_TestInit()
        {
            InitializeContext();
            BeforeInit();
            BeforeInitExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterInit();
            AfterInitExtension();
        }
        
        [TestCleanup()]
        public virtual void FixtureMethodsClass_TestTeardown()
        {
            BeforeTeardown();
            BeforeTeardownExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterTeardown();
            AfterTeardownExtension();
        }
        
        // TestComment
        [TestMethod()]
        public virtual void FixtureMethods()
        {
            SpecificationDefinition spec = new SpecificationDefinition();
            Get_FixtureMethods(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }
        }
        
        [SpecificationProviderAttribute(Name="Fixture methods")]
        public virtual void Get_FixtureMethods(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "Fixture methods";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture<DescriptionFixture>();
#line 1
            fixture.WithRow("The most basic and effective way to write fixtures is to use fixture method.");
#line 2
            fixture.WithRow("Fixture methods can resides in the container class or in the specification class." +
                    " We will see specification classes later on, so this sample will use methods loc" +
                    "ated in the container.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 4
            fixture.WithRow("!let\'s see a first fixture method :!");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 6
            fixture.WithRow("Expect", "rocks", "isn\'t it ?");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 8
            fixture.WithRow("In the corresponding \".expect\" file, we have the following :");
#line 9
            fixture.WithRow("{{");
#line 10
            fixture.WithRow("Expect |rocks| isn\'t it ?");
#line 11
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 13
            fixture.WithRow("When you write fixture methods, parameters and text are separated with pipes (or " +
                    "\"|\"), and you alternate text and parameters.");
#line 14
            fixture.WithRow("You could put as many parameters as you want, as long as you alternate text and p" +
                    "arameters.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 16
            fixture.WithRow("To resolve this sentence, Expect search a method named as the concatenation of th" +
                    "e text parts, without any diacritic and with camel case.");
#line 17
            fixture.WithRow("With the above example, Expect looks for a method \"ExpectIsnTIt\" with 1 parameter" +
                    ", and in the container class.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 19
            fixture.WithRow("The container class owns the following method :");
#line 20
            fixture.WithRow("{{");
#line 21
            fixture.WithRow("[FixtureHint(\"Expect |*| isn\'t it ?\")]");
#line 22
            fixture.WithRow("[FixtureHint(\"This is a tool that |*|, isn\'t it ?\")]");
#line 23
            fixture.WithRow("public void ExpectIsnTIt(string qualifier)");
#line 24
            fixture.WithRow("{");
#line 25
            fixture.WithRow("\tAssert.AreEqual(\"rocks\", qualifier);");
#line 26
            fixture.WithRow("}");
#line 27
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 29
            fixture.WithRow("The FixtureHint attribute that decorate the method serve two purposes. ");
#line 30
            fixture.WithRow("First, It allows for having intellisense in Visual Studio on the \"natural\" form o" +
                    "f your sentence.");
#line 31
            fixture.WithRow("Second, it allow to map a sentence from something other than the method name. In " +
                    "fact, you could put several FixtureHint attributes on a method and use whatever " +
                    "sentence to resolve the fixture.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 33
            fixture.WithRow("The following sentence is resolved through the same container\'s method \"ExpectIsn" +
                    "TIt\" thanks to FixtureHint attribute :");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 34
            fixture.WithRow("This is a tool that", "rocks", ", isn\'t it ?");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 36
            fixture.WithRow("There is another kind of fixture method called methods with fixture data. An exam" +
                    "ple will be more descriptive:");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 37
            fixture.WithRow("This is a fixture", "method", "with", "fixture data", "");
#line 38
            fixture.WithRow("Col 1", "Col 2", "Col 3");
#line 39
            fixture.WithRow("11", "12", "13");
#line 40
            fixture.WithRow("21", "22", "23");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 42
            fixture.WithRow("!The source specification looks like this! :");
#line 43
            fixture.WithRow("{{");
#line 44
            fixture.WithRow("This is a fixture |method| with |fixture data|");
#line 45
            fixture.WithRow("Col 1  | Col 2 | Col 3");
#line 46
            fixture.WithRow("    11 |    12 |    13");
#line 47
            fixture.WithRow("    21 |    22 |    23 ");
#line 48
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 50
            fixture.WithRow("This method is resolved just like a basic fixture method. The only difference is " +
                    "that the method must have an additionnal parameter of type *FixtureData*.");
#line 51
            fixture.WithRow("In this case, Expect search a method called \"ThisIsAFixtureWith\" with 3 parameter" +
                    "s, the last parameter beeing a *FixtureData*.");
#line 52
            fixture.WithRow("With this kind of fixture, the second line of the fixture is treated as column de" +
                    "finitions, and the other lines are data.");
#line 53
            fixture.WithRow("the *FixtureData* object is a list of rows, each row containing a dictionnary ind" +
                    "exed by column names.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 55
            fixture.WithRow("The method corresponding to the above is");
#line 56
            fixture.WithRow("{{");
#line 57
            fixture.WithRow("[FixtureHint(\"This is a fixture |*| with |*|\")]");
#line 58
            fixture.WithRow("public void ThisIsAFixtureWith(string fixtureType, string fixtureOptions, Fixture" +
                    "Data data)");
#line 59
            fixture.WithRow("{");
#line 60
            fixture.WithRow("\t...");
#line 61
            fixture.WithRow("}");
#line 62
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 64
            fixture.WithRow("When resolving a fixture, method with fixture data have priority over \"simple\" fi" +
                    "xture methods.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 66
            fixture.WithRow("In order to ease the developper\'s work, Expect provide some usefull shortcuts in " +
                    "the IDE. In Visual Studio, right click on the sentence in the \".expect\" file.");
#line 67
            fixture.WithRow("You must have a \"Go to fixture\" item within the Expect menu. This item will get y" +
                    "ou to the fixture implementation.");
#line 68
            fixture.WithRow("If you right click on an executable element that does not have implementation, th" +
                    "e framework also provide menus to generate fixture methods or fixture classes.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 70
            fixture.WithRow("With VS 2010 you could also use Smart-tags (by clicking them or using the Ctrl+\'." +
                    "\' shortcut).");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 72
            fixture.WithRow("An example of Smart-tags :");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<ImageDescriptionFixture>();
#line 73
            fixture.WithRow("images\\smarttag.png");
#line hidden
            fixture.EndRun();

        }
    }
}
